/* CONTROVERSY AND COSTS */

*CCES 2016 DATA

use  "Controversy_and_Costs_Replication_CCES2016.dta" // note:  Stata v.13

**************
*Figures 3 and 4
*Note: Some additional formatting may have been done using Graph Editor
**************

*install coefplot
*install blindschemes package

*Generate means for Figure 3
mean SupportID, over(ExpConditions3) // all
estimates store VIDall

*Generate means for Figure 4
mean SupportID if PID3==1 | CC16_421b==1, over(ExpConditions3) // Democrats incl. leaners
estimates store VIDdems

mean SupportID if PID3==2 | CC16_421b==2, over(ExpConditions3) // Republicans incl. leaners
estimates store VIDreps

*All respondents
coefplot VIDall, vertical recast(scatter) msymbol(circle_hollow) ///
fcolor(*.5) ciopts(recast(rcap)) levels(95) citop ylabel(3(.25)4.5) ///
coeflabel(_subpop_2 = "Minority: Citizens" _subpop_3 = "Minority: States" _subpop_4 = "Majority: Citizens" _subpop_5 = "Majority: States", labsize(small) wrap(20))   ///
scheme(plotplain)  graphregion(margin(small)) ///
xtitle("{bf:Amount of Public/State Support for Voter Identification Laws}", size(small)) ///
ytitle("{bf:Support for Voter Identification Laws}", size(medium)) 

*Partisans
coefplot VIDdems || VIDreps, vertical recast(scatter) msymbol(circle_hollow) fcolor(*.5) ///
ciopts(recast(rcap)) levels(95) citop ylabel(2(.5)5)  ///
coeflabel(_subpop_2 = "Minority: Citizens" _subpop_3 = "Minority: States" _subpop_4 = "Majority: Citizens" _subpop_5 = "Majority: States", labsize(vsmall) wrap(10))   ///
scheme(plotplain) graphregion(margin(vsmall)) ///
xtitle("{bf:Amount of Public/State Support for Voter Identification Laws}", size(small)) ///
ytitle("{bf:Support for Voter Identification Laws}", size(medium)) 

*Underlying regression models (see Supplemental Appendix)
	*All respondents
reg SupportID i.ExpConditions3
	*Democrats (including leaners)
reg SupportID i.ExpConditions3 if PID3==1 | CC16_421b==1 
	*Republicans (including leaners)
reg SupportID i.ExpConditions3 if PID3==2 | CC16_421b==2 

*Change in ∆pr(y=support) 
		*All
reg SupportID_binary i.ExpConditions3  
	*Democrats (including leaners)
reg SupportID_binary i.ExpConditions3 if PID3==1 | CC16_421b==1
	*Republicans (including leaners)
reg SupportID_binary i.ExpConditions3 if PID3==2 | CC16_421b==2

**********
**********
